#!/usr/bin/env python
# -*- coding:utf-8 -*-
# Create by zhang
# Create on 2022/6/22 22:16
from os import sep
import pandas as pd

from domain.transaction_data.repository.impl import cvs_repository
from config.config import config


def read_closed_cal():
    """
    读取交易日历csv文件
    :return:pd.DataFrame
    """
    return cvs_repository.cvs_reader_only(config.get('data', 'folder') + sep + "closed.csv")  # type:pd.DataFrame


def write_trade_cal(df: pd.DataFrame):
    """
    保存交易日历csv文件
    :param df:
    :return:
    """
    df.to_csv(config.get('data', 'folder') + sep + "trade_cal.csv")